<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 1. Boost.Contract 1.0.0</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="Chapter 1. Boost.Contract 1.0.0">
<link rel="next" href="boost_contract/full_table_of_contents.html" title="Full Table of Contents">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav"><a accesskey="n" href="boost_contract/full_table_of_contents.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>
<div class="chapter">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="boost_contract"></a>Chapter 1. Boost.Contract 1.0.0</h2></div>
<div><div class="author"><h3 class="author">
<span class="firstname">Lorenzo</span> <span class="surname">Caminiti <code class="email">&lt;<a class="email" href="mailto:lorcaminiti@gmail.com">lorcaminiti@gmail.com</a>&gt;</code></span>
</h3></div></div>
<div><p class="copyright">Copyright © 2008-2019 Lorenzo Caminiti</p></div>
<div><div class="legalnotice">
<a name="boost_contract.legal"></a><p>
        Distributed under the Boost Software License, Version 1.0 (see accompanying
        file LICENSE_1_0.txt or a copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></div>
</div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="section"><a href="index.html#boost_contract.introduction">Introduction</a></span></dt>
<dt><span class="section"><a href="boost_contract/full_table_of_contents.html">Full Table of Contents</a></span></dt>
<dt><span class="section"><a href="boost_contract/getting_started.html">Getting Started</a></span></dt>
<dt><span class="section"><a href="boost_contract/contract_programming_overview.html">Contract
    Programming Overview</a></span></dt>
<dt><span class="section"><a href="boost_contract/tutorial.html">Tutorial</a></span></dt>
<dt><span class="section"><a href="boost_contract/advanced.html">Advanced</a></span></dt>
<dt><span class="section"><a href="boost_contract/extras.html">Extras</a></span></dt>
<dt><span class="section"><a href="boost_contract/examples.html">Examples</a></span></dt>
<dt><span class="section"><a href="reference.html">Reference</a></span></dt>
<dt><span class="section"><a href="boost_contract/release_notes.html">Release Notes</a></span></dt>
<dt><span class="section"><a href="boost_contract/bibliography.html">Bibliography</a></span></dt>
<dt><span class="section"><a href="boost_contract/acknowledgments.html">Acknowledgments</a></span></dt>
</dl>
</div>
<div class="blockquote"><blockquote class="blockquote"><p>
      <span class="emphasis"><em><span class="quote">“<span class="quote">Our field needs more formality, but the profession has not
      realized it yet.</span>”</span></em></span>
    </p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
      <span class="emphasis"><em>-- Bertrand Meyer (see <a class="link" href="boost_contract/bibliography.html#Meyer97_anchor">[Meyer97]</a>
      page 400)</em></span>
    </p></blockquote></div>
<p>
    This library implements <a href="http://en.wikipedia.org/wiki/Design_by_contract" target="_top">contract
    programming</a> (a.k.a., Design by Contract or DbC) <a href="#ftn.boost_contract.f0" class="footnote" name="boost_contract.f0"><sup class="footnote">[1]</sup></a> for the C++ programming language. All contract programming features
    are supported by this library: Subcontracting, class invariants (also for static
    and volatile member functions), postconditions (with old and return values),
    preconditions, customizable actions on assertion failure (e.g., terminate the
    program or throw exceptions), optional compilation of assertions, disable assertions
    while already checking other assertions (to avoid infinite recursion), and more
    (see <a class="link" href="boost_contract/contract_programming_overview.html#boost_contract.contract_programming_overview.feature_summary" title="Feature Summary">Feature
    Summary</a>).
  </p>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_contract.introduction"></a><a class="link" href="index.html#boost_contract.introduction" title="Introduction">Introduction</a>
</h2></div></div></div>
<p>
      Contract programming allows to specify preconditions, postconditions, and class
      invariants that are automatically checked when functions are executed at run-time.
      These conditions assert program specifications within the source code itself
      allowing to find bugs more quickly during testing, making the code self-documenting,
      and increasing overall software quality (see <a class="link" href="boost_contract/contract_programming_overview.html" title="Contract Programming Overview">Contract
      Programming Overview</a>).
    </p>
<p>
      For example, consider the following function <code class="computeroutput"><span class="identifier">inc</span></code>
      that increments its argument <code class="computeroutput"><span class="identifier">x</span></code>
      by <code class="computeroutput"><span class="number">1</span></code> and let's write its contract
      using code comments (see <a href="../../example/features/introduction_comments.cpp" target="_top"><code class="literal">introduction_comments.cpp</code></a>):
    </p>
<p>
</p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">inc</span><span class="special">(</span><span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span>
    <span class="comment">// Precondition:    x &lt; std::numeric_limit&lt;int&gt;::max()</span>
    <span class="comment">// Postcondition:   x == oldof(x) + 1</span>
<span class="special">{</span>
    <span class="special">++</span><span class="identifier">x</span><span class="special">;</span> <span class="comment">// Function body.</span>
<span class="special">}</span>
</pre>
<p>
    </p>
<p>
      The precondition states that at function entry the argument <code class="computeroutput"><span class="identifier">x</span></code>
      must be strictly smaller than the maximum allowable value of its type (so it
      can be incremented by <code class="computeroutput"><span class="number">1</span></code> without
      overflowing). The postcondition states that at function exit the argument
      <code class="computeroutput"><span class="identifier">x</span></code> must be incremented by <code class="computeroutput"><span class="number">1</span></code> with respect to the <span class="emphasis"><em>old value</em></span>
      that <code class="computeroutput"><span class="identifier">x</span></code> had before executing
      the function (indicated here by <code class="literal"><span class="emphasis"><em>oldof</em></span></code><code class="computeroutput"><span class="special">(</span><span class="identifier">x</span><span class="special">)</span></code>).
      Note that postconditions shall be checked only when the execution of the function
      body does not throw an exception.
    </p>
<p>
      Now let's program this function and its contract using this library (see <a href="../../example/features/introduction.cpp" target="_top"><code class="literal">introduction.cpp</code></a>
      and <a class="link" href="boost_contract/tutorial.html#boost_contract.tutorial.non_member_functions" title="Non-Member Functions">Non-Member
      Functions</a>):
    </p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">contract</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="keyword">void</span> <span class="identifier">inc</span><span class="special">(</span><span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">old_ptr</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">old_x</span> <span class="special">=</span> <span class="identifier">BOOST_CONTRACT_OLDOF</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span> <span class="comment">// Old value.</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">check</span> <span class="identifier">c</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">function</span><span class="special">()</span>
        <span class="special">.</span><span class="identifier">precondition</span><span class="special">([&amp;]</span> <span class="special">{</span>
            <span class="identifier">BOOST_CONTRACT_ASSERT</span><span class="special">(</span><span class="identifier">x</span> <span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;::</span><span class="identifier">max</span><span class="special">());</span> <span class="comment">// Line 17.</span>
        <span class="special">})</span>
        <span class="special">.</span><span class="identifier">postcondition</span><span class="special">([&amp;]</span> <span class="special">{</span>
            <span class="identifier">BOOST_CONTRACT_ASSERT</span><span class="special">(</span><span class="identifier">x</span> <span class="special">==</span> <span class="special">*</span><span class="identifier">old_x</span> <span class="special">+</span> <span class="number">1</span><span class="special">);</span> <span class="comment">// Line 20.</span>
        <span class="special">})</span>
    <span class="special">;</span>

    <span class="special">++</span><span class="identifier">x</span><span class="special">;</span> <span class="comment">// Function body.</span>
<span class="special">}</span>
</pre>
<p>
    </p>
<p>
      When the above function <code class="computeroutput"><span class="identifier">inc</span></code>
      is called, this library will:
    </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
          First, execute the functor passed to <code class="computeroutput"><span class="special">.</span><span class="identifier">precondition</span><span class="special">(...)</span></code>
          that asserts <code class="computeroutput"><span class="identifier">inc</span></code> precondition.
        </li>
<li class="listitem">
          Then, execute <code class="computeroutput"><span class="identifier">inc</span></code> body
          (i.e., all the code that follows the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">check</span> <span class="identifier">c</span> <span class="special">=</span> <span class="special">...</span></code> declaration).
        </li>
<li class="listitem">
          Last, execute the functor passed to <code class="computeroutput"><span class="special">.</span><span class="identifier">postcondition</span><span class="special">(...)</span></code>
          that asserts <code class="computeroutput"><span class="identifier">inc</span></code> postcondition
          (unless <code class="computeroutput"><span class="identifier">inc</span></code> body threw
          an exception).
        </li>
</ul></div>
<p>
      For example, if there is a bug in the code calling <code class="computeroutput"><span class="identifier">inc</span></code>
      so that the function is called with <code class="computeroutput"><span class="identifier">x</span></code>
      equal to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;::</span><span class="identifier">max</span><span class="special">()</span></code> then the program will terminate with an error
      message similar to the following (and it will be evident that the bug is in
      the calling code):
    </p>
<pre class="programlisting">precondition assertion "x &lt; std::numeric_limits&lt;int&gt;::max()" failed: file "introduction.cpp", line 17
</pre>
<p>
      Instead, if there is a bug in the implementation of <code class="computeroutput"><span class="identifier">inc</span></code>
      so that <code class="computeroutput"><span class="identifier">x</span></code> is not incremented
      by <code class="computeroutput"><span class="number">1</span></code> after the execution of the
      function body then the program will terminate with an error message similar
      to the following (and it will be evident that the bug is in <code class="computeroutput"><span class="identifier">inc</span></code>
      body): <a href="#ftn.boost_contract.introduction.f0" class="footnote" name="boost_contract.introduction.f0"><sup class="footnote">[2]</sup></a>
    </p>
<pre class="programlisting">postcondition assertion "x == *old_x + 1" failed: file "introduction.cpp", line 20
</pre>
<p>
      By default, when an assertion fails this library prints an error message such
      the ones above to the standard error <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cerr</span></code> and
      terminates the program calling <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">terminate</span></code>
      (this behaviour can be customized to take any user-specified action including
      throwing exceptions, see <a class="link" href="boost_contract/advanced.html#boost_contract.advanced.throw_on_failures__and__noexcept__" title="Throw on Failures (and noexcept)">Throw
      on Failures</a>). Note that the error messages printed by this library contain
      all the information necessary to easily and uniquely identify the point in
      the code at which contract assertions fail. <a href="#ftn.boost_contract.introduction.f1" class="footnote" name="boost_contract.introduction.f1"><sup class="footnote">[3]</sup></a>
    </p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>
        C++11 lambda functions are necessary to use this library without manually
        writing a significant amount of boiler-plate code to program functors that
        assert the contracts (see <a class="link" href="boost_contract/extras.html#boost_contract.extras.no_lambda_functions__no_c__11_" title="No Lambda Functions (No C++11)">No
        Lambda Functions</a>). That said, this library implementation does not
        use C++11 features and should work on most modern C++ compilers (see <a class="link" href="boost_contract/getting_started.html" title="Getting Started">Getting Started</a>).
      </p></td></tr>
</table></div>
<p>
      In addition to contracts for non-member functions as shown the in the example
      above, this library allows to program contracts for constructors, destructors,
      and member functions. These can check class invariants and can also <span class="emphasis"><em>subcontract</em></span>
      inheriting and extending contracts from base classes (see <a href="../../example/features/introduction_public.cpp" target="_top"><code class="literal">introduction_public.cpp</code></a>
      and <a class="link" href="boost_contract/tutorial.html#boost_contract.tutorial.public_function_overrides__subcontracting_" title="Public Function Overrides (Subcontracting)">Public
      Function Overrides</a>): <a href="#ftn.boost_contract.introduction.f2" class="footnote" name="boost_contract.introduction.f2"><sup class="footnote">[4]</sup></a>
    </p>
<p>
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">class</span> <span class="identifier">vector</span>
    <span class="preprocessor">#define</span> <span class="identifier">BASES</span> <span class="keyword">public</span> <span class="identifier">pushable</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span>
    <span class="special">:</span> <span class="identifier">BASES</span>
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
    <span class="keyword">typedef</span> <span class="identifier">BOOST_CONTRACT_BASE_TYPES</span><span class="special">(</span><span class="identifier">BASES</span><span class="special">)</span> <span class="identifier">base_types</span><span class="special">;</span> <span class="comment">// For subcontracting.</span>
    <span class="preprocessor">#undef</span> <span class="identifier">BASES</span>

    <span class="keyword">void</span> <span class="identifier">invariant</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span> <span class="comment">// Checked in AND with base class invariants.</span>
        <span class="identifier">BOOST_CONTRACT_ASSERT</span><span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;=</span> <span class="identifier">capacity</span><span class="special">());</span>
    <span class="special">}</span>

    <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">push_back</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">value</span><span class="special">,</span>
            <span class="identifier">boost</span><span class="special">::</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">virtual_</span><span class="special">*</span> <span class="identifier">v</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="comment">/* override */</span> <span class="special">{</span> <span class="comment">// For virtuals.</span>
        <span class="identifier">boost</span><span class="special">::</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">old_ptr</span><span class="special">&lt;</span><span class="keyword">unsigned</span><span class="special">&gt;</span> <span class="identifier">old_size</span> <span class="special">=</span>
                <span class="identifier">BOOST_CONTRACT_OLDOF</span><span class="special">(</span><span class="identifier">v</span><span class="special">,</span> <span class="identifier">size</span><span class="special">());</span> <span class="comment">// Old values for virtuals.</span>
        <span class="identifier">boost</span><span class="special">::</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">check</span> <span class="identifier">c</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">contract</span><span class="special">::</span><span class="identifier">public_function</span><span class="special">&lt;</span> <span class="comment">// For overrides.</span>
                <span class="identifier">override_push_back</span><span class="special">&gt;(</span><span class="identifier">v</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">vector</span><span class="special">::</span><span class="identifier">push_back</span><span class="special">,</span> <span class="keyword">this</span><span class="special">,</span> <span class="identifier">value</span><span class="special">)</span>
            <span class="special">.</span><span class="identifier">precondition</span><span class="special">([&amp;]</span> <span class="special">{</span> <span class="comment">// Checked in OR with base preconditions.</span>
                <span class="identifier">BOOST_CONTRACT_ASSERT</span><span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">&lt;</span> <span class="identifier">max_size</span><span class="special">());</span>
            <span class="special">})</span>
            <span class="special">.</span><span class="identifier">postcondition</span><span class="special">([&amp;]</span> <span class="special">{</span> <span class="comment">// Checked in AND with base postconditions.</span>
                <span class="identifier">BOOST_CONTRACT_ASSERT</span><span class="special">(</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="special">*</span><span class="identifier">old_size</span> <span class="special">+</span> <span class="number">1</span><span class="special">);</span>
            <span class="special">})</span>
        <span class="special">;</span>

        <span class="identifier">vect_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">value</span><span class="special">);</span>
    <span class="special">}</span>
    <span class="identifier">BOOST_CONTRACT_OVERRIDE</span><span class="special">(</span><span class="identifier">push_back</span><span class="special">)</span> <span class="comment">// Define `override_push_back` above.</span>

    <span class="comment">// Could program contracts for those as well.</span>
    <span class="keyword">unsigned</span> <span class="identifier">size</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vect_</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">}</span>
    <span class="keyword">unsigned</span> <span class="identifier">max_size</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vect_</span><span class="special">.</span><span class="identifier">max_size</span><span class="special">();</span> <span class="special">}</span>
    <span class="keyword">unsigned</span> <span class="identifier">capacity</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">vect_</span><span class="special">.</span><span class="identifier">capacity</span><span class="special">();</span> <span class="special">}</span>

<span class="keyword">private</span><span class="special">:</span>
    <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">vect_</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<p>
    </p>
<h4>
<a name="boost_contract.introduction.h0"></a>
      <span class="phrase"><a name="boost_contract.introduction.language_support"></a></span><a class="link" href="index.html#boost_contract.introduction.language_support">Language
      Support</a>
    </h4>
<p>
      The authors of this library advocate for contracts to be added to the core
      language. Adding contract programming to the C++ standard has a number of advantages
      over any library implementation (shorter and more concise syntax to program
      contracts, specify contracts in declarations instead of definitions, enforce
      contract constant-correctness, expected faster compile- and run-time, vendors
      could develop static analysis tools to recognize and check contracts statically
      when possible, compiler optimizations could be improved based on contract conditions,
      etc.).
    </p>
<p>
      The <a class="link" href="boost_contract/bibliography.html#P0380_anchor">[P0380]</a> proposal supports basic contract
      programming, it was accepted and it will be included in C++20. This is undoubtedly
      a step in the right direction, but unfortunately <a class="link" href="boost_contract/bibliography.html#P0380_anchor">[P0380]</a>
      only supports pre- and postconditions while missing important features such
      as class invariants and old values in postconditions, not to mention the lack
      of more advanced features like subcontracting (more complete proposals like
      <a class="link" href="boost_contract/bibliography.html#N1962_anchor">[N1962]</a> were rejected by the C++ standard
      committee). All contracting programming features are instead supported by this
      library (see <a class="link" href="boost_contract/contract_programming_overview.html#boost_contract.contract_programming_overview.feature_summary" title="Feature Summary">Feature
      Summary</a> for a detailed comparison between the features supported by
      this library and the ones listed in different contract programming proposals,
      see <a class="link" href="boost_contract/bibliography.html" title="Bibliography">Bibliography</a> for a list
      of references considered during the design and implementation of this library,
      including the vast majority of contract programming proposals submitted to
      the C++ standard committee).
    </p>
</div>
<div class="footnotes">
<br><hr style="width:100; text-align:left;margin-left: 0">
<div id="ftn.boost_contract.f0" class="footnote"><p><a href="#boost_contract.f0" class="para"><sup class="para">[1] </sup></a>
      Design by Contract (DbC) is a registered trademark of the Eiffel Software company
      and it was first introduced by the Eiffel programming language (see <a class="link" href="boost_contract/bibliography.html#Meyer97_anchor">[Meyer97]</a>).
    </p></div>
<div id="ftn.boost_contract.introduction.f0" class="footnote"><p><a href="#boost_contract.introduction.f0" class="para"><sup class="para">[2] </sup></a>
        In this example the function body is composed of a single trivial instruction
        <code class="computeroutput"><span class="special">++</span><span class="identifier">x</span></code>
        so it easy to check by visual inspection that it does not contain any bug
        and it will always increment <code class="computeroutput"><span class="identifier">x</span></code>
        by <code class="computeroutput"><span class="number">1</span></code> thus the function postcondition
        will never fail. In real production code, function bodies are rarely this
        simple and can hide bugs which make checking postconditions useful.
      </p></div>
<div id="ftn.boost_contract.introduction.f1" class="footnote"><p><a href="#boost_contract.introduction.f1" class="para"><sup class="para">[3] </sup></a>
        <span class="bold"><strong>Rationale:</strong></span> The assertion failure message
        printed by this library follows a format similar to the message printed by
        Clang when the C-style <code class="computeroutput"><span class="identifier">assert</span></code>
        macro fails.
      </p></div>
<div id="ftn.boost_contract.introduction.f2" class="footnote"><p><a href="#boost_contract.introduction.f2" class="para"><sup class="para">[4] </sup></a>
        The <code class="computeroutput"><span class="identifier">pushable</span></code> base class is
        used in this example just to show subcontracting, it is somewhat arbitrary
        and it will likely not appear in real production code.
      </p></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: August 05, 2021 at 09:50:23 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
<div class="spirit-nav"><a accesskey="n" href="boost_contract/full_table_of_contents.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>
</body>
</html>
